<!-- 
* 类型选择界面
* 2019年5月16日17:06:10
* penglei
* -->
<template>
    <view class="content">
		<mbtn class="outer_btn" @click="toMx" :listData="list"/>
		<cmd-bottom-nav @click="tapNav"  border-color="#BC1BBE" background-color="#BC1BBE" font-color="#fff" active-font-color="rgb(255, 106, 68)"  current="1" :BOTTOM_DISTANCE="getModel"></cmd-bottom-nav>
    </view>
</template>

<script>
    // import {
    //     mapState
    // } from 'vuex'
	import cmdBottomNav from "@/components/cmd-bottom-nav/cmd-bottom-nav.vue"
	import mbtn from "@/components/m-btn-type/m-btn.vue"
	import mtabbar from "@/components/m-tabbar/m-tabbar.vue";
	import comm from '../../common/helpers.js'
    export default {
		components:{mbtn,mtabbar,cmdBottomNav},
		data(){
			return{
				list:[],
				BOTTOM_DISTANCE:false
			}
		},
        onLoad(e) {
			uni.request({
				url: comm.websiteUrl+'?s=v1/gettypes/',
				method: 'POST',
				data: {
					'tid':e.tid
				},
				success: res => {
					this.list = res.data.data
				},
				fail: () => {},
				complete: () => {}
			});
        },
		onShow() {
			uni.setStorageSync('m23lock',0)
			uni.setStorageSync('m32lock',0)
			uni.setStorageSync('m33lock',0)
		},
		methods:{
			tapNav(e){
				let path = e.item.pagePath
				uni.switchTab({
					url:path,
					success: (res) => {
						
					},
					complete: (com) => {
					}
				})
			},
			toMx(e){
				uni.redirectTo({
					url:'../../pages/divine/main_mx?type='+e.type+"&rule="+e.rule,
					success: (res) => {
						
					},
					complete: (cop) => {
						// console.log('跳转冥想界面成功...')
					}
				})
			}
		},
		computed:{
			getModel(){
				return uni.getStorageSync('model')
			}
		}
    }
</script>

<style lang="scss">
	.content{
		padding: 0upx;
		background-image: url("https://zhanbu.nomeis.cn/upload/page_resource/bg3.png");
		background-size: 100% 90%;
		
		._bg{
			width: 100%;
			height:90%;
			vertical-align: top;
			top: 0;
			right: 0;
			position:absolute;
			vertical-align: middle;
		}
		
		.outer_btn{
			height: 100%;
			justify-content:center;
			align-items:center;
			display:flex;
		}
	}
</style>
